<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<!-- 1、请写一个函数，输出多级嵌套结构的Object的所有的key值
var obj = {
  a: '12',
  b: '23',
  first:{
    c:'34',
    d: '45',
    second: {
      e: '56',
      f: '67',
      three:{
        g: '78',
        h: '89',
        i: '90'
      }
    }
  }
}

function getAllKey(obj){
  
}

//输出 [a,b,c,d,e,f,g,h,i] -->

<body>
    <div>test13-1</div>
    <script>
        var obj = {
            a: '12',
            b: '23',
            first: {
                c: '34',
                d: '45',
                second: {
                    e: '56',
                    f: '67',
                    three: {
                        g: '78',
                        h: '89',
                        i: '90'
                    }
                }
            }
        }
        let arr = []
        function getAllKey(obj) {
            for (const key in obj) {
                if (Object.hasOwnProperty.call(obj, key)) {
                    obj[key] instanceof Object ? getAllKey(obj[key]) : arr.push(key)
                }
            }
            console.log(arr)
        }
        getAllKey(obj)
    </script>
</body>

</html>